package com.ssy.lingxi.order.model.vo.common.response;

import com.ssy.lingxi.common.constant.order.OrderTypeEnum;
import com.ssy.lingxi.order.model.constant.OrderOuterStatusEnum;
import com.ssy.lingxi.order.model.constant.OrderServiceContants;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

/**
 * 售后能力 - 退货换货 - 查询订单商品列表返回
 * @author 万宁
 * @version 2.0.0
 * @date 2021-08-04
 */
public class OrderAfterSalePageQueryVO implements Serializable {
    private static final long serialVersionUID = -1429417821303763899L;

    public OrderAfterSalePageQueryVO(Long shopId, Long orderId, String orderNo, String digest, Long vendorMemberId, Long vendorRoleId, String vendorMemberName, Integer orderType, LocalDateTime createTime, Integer outerStatus, Long contractId, String contractNo, List<OrderAfterSaleProductDetailVO> products) {
        this.shopId = shopId;
        this.orderId = orderId;
        this.orderNo = orderNo;
        this.digest = digest;
        this.vendorMemberId = vendorMemberId;
        this.vendorRoleId = vendorRoleId;
        this.vendorMemberName = vendorMemberName;
        this.logo = "";
        this.orderType = orderType;
        this.orderTypeName = OrderTypeEnum.getNameByCode(this.orderType);
        this.createTime = createTime.format(OrderServiceContants.DEFAULT_TIME_FORMATTER);
        this.outerStatus = outerStatus;
        this.outerStatusName = OrderOuterStatusEnum.getNameByCode(this.getOuterStatus());
        this.contractId = contractId == null ? 0L : contractId;
        this.contractNo = StringUtils.hasLength(contractNo) ? contractNo : "";
        this.products = CollectionUtils.isEmpty(products) ? new ArrayList<>() : products;
    }

    /**
     * 订单来源商城Id
     */
    private Long shopId;

    /**
     * 订单Id
     */
    private Long orderId;

    /**
     * 订单编号
     */
    private String orderNo;

    /**
     * 订单摘要
     */
    private String digest;

    /**
     * 供应会员Id
     */
    private Long vendorMemberId;

    /**
     * 供应会员角色Id
     */
    private Long vendorRoleId;

    /**
     * 供应会员名称
     */
    private String vendorMemberName;

    /**
     * 供应会员店铺Logo
     */
    private String logo;

    /**
     * 订单类型枚举
     */
    private Integer orderType;

    /**
     * 订单类型名称
     */
    private String orderTypeName;

    /**
     * 订单创建时间
      */
    private String createTime;

    /**
     * 外部状态枚举
     */
    private Integer outerStatus;

    /**
     * 外部状态名称
     */
    private String outerStatusName;

    /**
     * 合同Id
     */
    private Long contractId;

    /**
     * 合同编号
     */
    private String contractNo;

    /**
     * 订单商品列表
     */
    private List<OrderAfterSaleProductDetailVO> products;

    public Long getShopId() {
        return shopId;
    }

    public void setShopId(Long shopId) {
        this.shopId = shopId;
    }

    public Long getOrderId() {
        return orderId;
    }

    public void setOrderId(Long orderId) {
        this.orderId = orderId;
    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public String getDigest() {
        return digest;
    }

    public void setDigest(String digest) {
        this.digest = digest;
    }

    public Long getVendorMemberId() {
        return vendorMemberId;
    }

    public void setVendorMemberId(Long vendorMemberId) {
        this.vendorMemberId = vendorMemberId;
    }

    public Long getVendorRoleId() {
        return vendorRoleId;
    }

    public void setVendorRoleId(Long vendorRoleId) {
        this.vendorRoleId = vendorRoleId;
    }

    public String getVendorMemberName() {
        return vendorMemberName;
    }

    public void setVendorMemberName(String vendorMemberName) {
        this.vendorMemberName = vendorMemberName;
    }

    public String getLogo() {
        return logo;
    }

    public void setLogo(String logo) {
        this.logo = logo;
    }

    public Integer getOrderType() {
        return orderType;
    }

    public void setOrderType(Integer orderType) {
        this.orderType = orderType;
    }

    public String getOrderTypeName() {
        return orderTypeName;
    }

    public void setOrderTypeName(String orderTypeName) {
        this.orderTypeName = orderTypeName;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public Integer getOuterStatus() {
        return outerStatus;
    }

    public void setOuterStatus(Integer outerStatus) {
        this.outerStatus = outerStatus;
    }

    public String getOuterStatusName() {
        return outerStatusName;
    }

    public void setOuterStatusName(String outerStatusName) {
        this.outerStatusName = outerStatusName;
    }

    public Long getContractId() {
        return contractId;
    }

    public void setContractId(Long contractId) {
        this.contractId = contractId;
    }

    public String getContractNo() {
        return contractNo;
    }

    public void setContractNo(String contractNo) {
        this.contractNo = contractNo;
    }

    public List<OrderAfterSaleProductDetailVO> getProducts() {
        return products;
    }

    public void setProducts(List<OrderAfterSaleProductDetailVO> products) {
        this.products = products;
    }
}
